﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataAccessClasses;
using System.Data.Common;
using System.Data;
using mobliebo;


namespace mobliebo
{
   public class Userlog
    {
        iDAC DAC = DACFactory.GetDAC();
        private long _id=-99;
        private string _Emailid = "";
        private string _password = "";
        public long id
        {
            get
            {
                return _id;
            }
            set
            {
                _id = value;
            }

        }
        public string password
        {
            get
            {
                return _password;
            }
            set
            {
                _password = value;
            }
        }
        public string Emailid
        {
            get
            {
                return _Emailid;
            }
            set
            {
               
                _Emailid= value;
            }
        }
        public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@id", id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@Emailid", Emailid, DbType.AnsiString, ParameterDirection.Input);

                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1,dbparam2};
                return DAC.Save("Userlogin_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return -99;
        }
        public DataTable GetRecords( long id,string Emailid, string password, string andor)
        {
            try
            {

                DbParameter dbparam0 = DAC.Parameter("@id", id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@password", password, DbType.AnsiString, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@andor", andor, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@Emailid", Emailid, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2,dbparam3 };
                //  return DAC.Select("Userlogin_get",dbparamcall);
                DataTable dt1 = DAC.Select("Userlogin_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long Result = -99;
            }
            return null;
        }



    }
}
